/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "questionnaire_questions" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "QuestionnaireQuestions.findAll" , query = "SELECT q FROM QuestionnaireQuestions q" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByQnrQuestId" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.qnrQuestId = :qnrQuestId" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByQuestSequence" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.questSequence = :questSequence" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByStatus" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.status = :status" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByCombineWithPrevious" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.combineWithPrevious = :combineWithPrevious" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByParentQuestion" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.parentQuestion = :parentQuestion" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByCategoryContentId" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.categoryContentId = :categoryContentId" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByShowInPaper" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.showInPaper = :showInPaper" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByShowInElectronic" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.showInElectronic = :showInElectronic" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByCanBreakBeforeInPaper" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.canBreakBeforeInPaper = :canBreakBeforeInPaper" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByCanBreakBeforeInElectronic" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.canBreakBeforeInElectronic = :canBreakBeforeInElectronic" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByCreatedBy" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.createdBy = :createdBy" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByDateCreated" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByModifiedBy" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByDateModified" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.dateModified = :dateModified" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByUseAlphaSuffix" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.useAlphaSuffix = :useAlphaSuffix" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByMustBreakBeforeInPaper" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.mustBreakBeforeInPaper = :mustBreakBeforeInPaper" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByRegionGroupTag" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.regionGroupTag = :regionGroupTag" ) ,
    @NamedQuery( name = "QuestionnaireQuestions.findByQuestionNumber" , query = "SELECT q FROM QuestionnaireQuestions q WHERE q.questionNumber = :questionNumber" )
} )
public class QuestionnaireQuestions implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "qnr_quest_id" )
    private String qnrQuestId;
    @Basic( optional = false )
    @Column( name = "quest_sequence" )
    private BigInteger questSequence;
    @Column( name = "status" )
    private String status;
    @Column( name = "combine_with_previous" )
    private String combineWithPrevious;
    @Column( name = "parent_question" )
    private String parentQuestion;
    @Basic( optional = false )
    @Column( name = "category_content_id" )
    private String categoryContentId;
    @Column( name = "show_in_paper" )
    private String showInPaper;
    @Column( name = "show_in_electronic" )
    private String showInElectronic;
    @Column( name = "can_break_before_in_paper" )
    private String canBreakBeforeInPaper;
    @Column( name = "can_break_before_in_electronic" )
    private String canBreakBeforeInElectronic;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @Basic( optional = false )
    @Column( name = "use_alpha_suffix" )
    private char useAlphaSuffix;
    @Column( name = "must_break_before_in_paper" )
    private String mustBreakBeforeInPaper;
    @Column( name = "region_group_tag" )
    private String regionGroupTag;
    @Column( name = "question_number" )
    private String questionNumber;
    @JoinColumn( name = "qnr_id" , referencedColumnName = "qnr_id" )
    @ManyToOne( optional = false )
    private Questionnaires qnrId;
    @JoinColumn( name = "quest_id" , referencedColumnName = "quest_id" )
    @ManyToOne( optional = false )
    private QuestionTitle questId;


    public QuestionnaireQuestions()
    {
    }


    public QuestionnaireQuestions( String qnrQuestId )
    {
        this.qnrQuestId = qnrQuestId;
    }


    public QuestionnaireQuestions( String qnrQuestId , BigInteger questSequence , String categoryContentId , String createdBy , Date dateCreated , char useAlphaSuffix )
    {
        this.qnrQuestId = qnrQuestId;
        this.questSequence = questSequence;
        this.categoryContentId = categoryContentId;
        this.createdBy = createdBy;
        this.dateCreated = dateCreated;
        this.useAlphaSuffix = useAlphaSuffix;
    }


    public String getQnrQuestId()
    {
        return qnrQuestId;
    }


    public void setQnrQuestId( String qnrQuestId )
    {
        this.qnrQuestId = qnrQuestId;
    }


    public BigInteger getQuestSequence()
    {
        return questSequence;
    }


    public void setQuestSequence( BigInteger questSequence )
    {
        this.questSequence = questSequence;
    }


    public String getStatus()
    {
        return status;
    }


    public void setStatus( String status )
    {
        this.status = status;
    }


    public String getCombineWithPrevious()
    {
        return combineWithPrevious;
    }


    public void setCombineWithPrevious( String combineWithPrevious )
    {
        this.combineWithPrevious = combineWithPrevious;
    }


    public String getParentQuestion()
    {
        return parentQuestion;
    }


    public void setParentQuestion( String parentQuestion )
    {
        this.parentQuestion = parentQuestion;
    }


    public String getCategoryContentId()
    {
        return categoryContentId;
    }


    public void setCategoryContentId( String categoryContentId )
    {
        this.categoryContentId = categoryContentId;
    }


    public String getShowInPaper()
    {
        return showInPaper;
    }


    public void setShowInPaper( String showInPaper )
    {
        this.showInPaper = showInPaper;
    }


    public String getShowInElectronic()
    {
        return showInElectronic;
    }


    public void setShowInElectronic( String showInElectronic )
    {
        this.showInElectronic = showInElectronic;
    }


    public String getCanBreakBeforeInPaper()
    {
        return canBreakBeforeInPaper;
    }


    public void setCanBreakBeforeInPaper( String canBreakBeforeInPaper )
    {
        this.canBreakBeforeInPaper = canBreakBeforeInPaper;
    }


    public String getCanBreakBeforeInElectronic()
    {
        return canBreakBeforeInElectronic;
    }


    public void setCanBreakBeforeInElectronic( String canBreakBeforeInElectronic )
    {
        this.canBreakBeforeInElectronic = canBreakBeforeInElectronic;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    public char getUseAlphaSuffix()
    {
        return useAlphaSuffix;
    }


    public void setUseAlphaSuffix( char useAlphaSuffix )
    {
        this.useAlphaSuffix = useAlphaSuffix;
    }


    public String getMustBreakBeforeInPaper()
    {
        return mustBreakBeforeInPaper;
    }


    public void setMustBreakBeforeInPaper( String mustBreakBeforeInPaper )
    {
        this.mustBreakBeforeInPaper = mustBreakBeforeInPaper;
    }


    public String getRegionGroupTag()
    {
        return regionGroupTag;
    }


    public void setRegionGroupTag( String regionGroupTag )
    {
        this.regionGroupTag = regionGroupTag;
    }


    public String getQuestionNumber()
    {
        return questionNumber;
    }


    public void setQuestionNumber( String questionNumber )
    {
        this.questionNumber = questionNumber;
    }


    public Questionnaires getQnrId()
    {
        return qnrId;
    }


    public void setQnrId( Questionnaires qnrId )
    {
        this.qnrId = qnrId;
    }


    public QuestionTitle getQuestId()
    {
        return questId;
    }


    public void setQuestId( QuestionTitle questId )
    {
        this.questId = questId;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( qnrQuestId != null ? qnrQuestId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof QuestionnaireQuestions ) )
        {
            return false;
        }
        QuestionnaireQuestions other = (QuestionnaireQuestions) object;
        if ( ( this.qnrQuestId == null && other.qnrQuestId != null ) || ( this.qnrQuestId != null && !this.qnrQuestId.equals( other.qnrQuestId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.QuestionnaireQuestions[ qnrQuestId=" + qnrQuestId + " ]";
    }
    
}
